<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Nightscout API</title>

  <link rel="apple-touch-icon" sizes="57x57" href="/images/apple-touch-icon-57x57.png">
  <link rel="apple-touch-icon" sizes="60x60" href="/images/apple-touch-icon-60x60.png">
  <link rel="apple-touch-icon" sizes="72x72" href="/images/apple-touch-icon-72x72.png">
  <link rel="apple-touch-icon" sizes="76x76" href="/images/apple-touch-icon-76x76.png">
  <link rel="apple-touch-icon" sizes="114x114" href="/images/apple-touch-icon-114x114.png">
  <link rel="apple-touch-icon" sizes="120x120" href="/images/apple-touch-icon-120x120.png">
  <link rel="apple-touch-icon" sizes="144x144" href="/images/apple-touch-icon-144x144.png">
  <link rel="apple-touch-icon" sizes="152x152" href="/images/apple-touch-icon-152x152.png">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-180x180.png">
  <link rel="icon" type="image/png" href="/images/favicon-32x32.png" sizes="32x32">
  <link rel="icon" type="image/png" href="/images/android-chrome-192x192.png" sizes="192x192">
  <link rel="icon" type="image/png" href="/images/favicon-96x96.png" sizes="96x96">
  <link rel="icon" type="image/png" href="/images/favicon-16x16.png" sizes="16x16">
  <link rel="manifest" href="/manifest.json">
  <link rel="shortcut icon" href="/images/favicon.ico">
  <meta name="msapplication-TileColor" content="#00a300">
  <meta name="msapplication-TileImage" content="/images/mstile-144x144.png">
  <meta name="msapplication-config" content="/browserconfig.xml">
  <meta name="theme-color" content="#333333">

  <link href='/bower_components/swagger-ui/dist/css/typography.css' media='screen' rel='stylesheet' type='text/css'/>
  <link href='/bower_components/swagger-ui/dist/css/reset.css' media='screen' rel='stylesheet' type='text/css'/>
  <link href='/bower_components/swagger-ui/dist/css/screen.css' media='screen' rel='stylesheet' type='text/css'/>
  <link href='/bower_components/swagger-ui/dist/css/reset.css' media='print' rel='stylesheet' type='text/css'/>
  <link href='/bower_components/swagger-ui/dist/css/print.css' media='print' rel='stylesheet' type='text/css'/>
  <script src='/bower_components/swagger-ui/dist/lib/jquery-1.8.0.min.js' type='text/javascript'></script>
  <script src='/bower_components/swagger-ui/dist/lib/jquery.slideto.min.js' type='text/javascript'></script>
  <script src='/bower_components/swagger-ui/dist/lib/jquery.wiggle.min.js' type='text/javascript'></script>
  <script src='/bower_components/swagger-ui/dist/lib/jquery.ba-bbq.min.js' type='text/javascript'></script>
  <script src='/bower_components/swagger-ui/dist/lib/handlebars-2.0.0.js' type='text/javascript'></script>
  <script src='/bower_components/swagger-ui/dist/lib/underscore-min.js' type='text/javascript'></script>
  <script src='/bower_components/swagger-ui/dist/lib/backbone-min.js' type='text/javascript'></script>
  <script src='/bower_components/swagger-ui/dist/swagger-ui.js' type='text/javascript'></script>
  <script src='/bower_components/swagger-ui/dist/lib/highlight.7.3.pack.js' type='text/javascript'></script>
  <script src='/bower_components/swagger-ui/dist/lib/jsoneditor.min.js' type='text/javascript'></script>
  <script src='/bower_components/swagger-ui/dist/lib/marked.js' type='text/javascript'></script>
  <script src='/bower_components/swagger-ui/dist/lib/swagger-oauth.js' type='text/javascript'></script>

  <!-- Some basic translations -->
  <!-- <script src='lang/translator.js' type='text/javascript'></script> -->
  <!-- <script src='lang/ru.js' type='text/javascript'></script> -->
  <!-- <script src='lang/en.js' type='text/javascript'></script> -->

  <script type="text/javascript">
    $(function () {
      // Pre load translate...
      if(window.SwaggerTranslator) {
        window.SwaggerTranslator.translate();
      }
      window.swaggerUi = new SwaggerUi({
        url: '/swagger.yaml',
        dom_id: 'swagger-ui-container',
        supportedSubmitMethods: ['get', 'post', 'put', 'delete', 'patch'],
        onComplete: function(/*swaggerApi, swaggerUi*/){
          if(window.SwaggerTranslator) {
            window.SwaggerTranslator.translate();
          }

          $('pre code').each(function(i, e) {
            hljs.highlightBlock(e)
          });

          addApiKeyAuthorization();
        },
        onFailure: function(data) {
          log('Unable to Load SwaggerUI', data);
        },
        docExpansion: 'none',
        apisSorter: 'alpha',
        showRequestHeaders: false
      });

      function addApiKeyAuthorization(){
        var key = encodeURIComponent($('#input_apiKey')[0].value);
        if(key && key.trim() !== '') {
          var apiKeyAuth = new SwaggerClient.ApiKeyAuthorization('api_secret', key, 'query');
          window.swaggerUi.api.clientAuthorizations.add('api_secret', apiKeyAuth);
          log('added key ' + key);
        }
      }

      $('#input_apiKey').change(addApiKeyAuthorization);

      window.swaggerUi.load();
    });
  </script>
</head>

<body class="swagger-section">
<div id='header'>
  <div class="swagger-ui-wrap">
    <a id="logo" href="http://swagger.io">swagger</a>
    <form id='api_selector'>
      <div class='input'><input placeholder="http://example.com/api" id="input_baseUrl" name="baseUrl" type="text"/></div>
      <div class='input'><input placeholder="api_secret" id="input_apiKey" name="apiKey" type="text"/></div>
      <div class='input'><a id="explore" href="#" data-sw-translate>Explore</a></div>
    </form>
  </div>
</div>

<div id="message-bar" class="swagger-ui-wrap" data-sw-translate>&nbsp;</div>
<div id="swagger-ui-container" class="swagger-ui-wrap"></div>
</body>
</html>
